//
//  CXHTopOnInitAdapter.m
//  CXHAdSDK-TopOn
//
//  Created by 陈坤 on 2025/10/16.
//

#import "CXHTopOnInitAdapter.h"
#import <CXHAdSDK-Core/CXHAdSDK.h>
#import <CXHAdSDK-Kit/CXHUtilsKit.h>

@implementation CXHTopOnInitAdapter

- (void)initWithInitArgument:(ATAdInitArgument *)adInitArgument{
    NSString *domain = [adInitArgument.serverContentDic CXH_objectOrNilForKey:@"domain"];
    NSString *appid = [adInitArgument.serverContentDic CXH_objectOrNilForKey:@"appid"];
    if (!kCXHStringIsEmpty(appid)) {
        [CXHAdSDK initWithAppId:appid requestDomain:domain completionBlock:^(NSError * _Nullable error) {
            if (error) {
                [self notificationNetworkInitFail:error];
            } else {
                [self notificationNetworkInitSuccess];
            }
        }];
    }
}

#pragma mark - version
- (nullable NSString *)sdkVersion {
    return [CXHAdSDK getSDKVersion];
}

- (nullable NSString *)adapterVersion {
    return @"1.10.1";
}

@end
